.class public Lnbisdk/a;
.super Ljava/lang/Object;

# interfaces
.implements Lnbisdk/gd;


# instance fields
.field private a:Lnbisdk/ly;

.field private b:I

.field private c:Ljava/util/Hashtable;

.field private d:Lnbisdk/ov;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public constructor <init>(Lnbisdk/ly;I)V
    .locals 2

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/32 v0, 0x2000000

    invoke-static {v0, v1}, Lnbisdk/pn;->k(J)Lnbisdk/ov;

    move-result-object v0

    iput-object v0, p0, Lnbisdk/a;->d:Lnbisdk/ov;

    iput-object p1, p0, Lnbisdk/a;->a:Lnbisdk/ly;

    iput p2, p0, Lnbisdk/a;->b:I

    new-instance v0, Ljava/util/Hashtable;

    invoke-direct {v0}, Ljava/util/Hashtable;-><init>()V

    iput-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    return-void
.end method

.method public static a(I)Ljava/lang/String;
    .locals 1

    packed-switch p0, :pswitch_data_0

    :pswitch_0
    const-string v0, ""

    :goto_0
    return-object v0

    :pswitch_1
    const-string v0, "initial"

    goto :goto_0

    :pswitch_2
    const-string v0, "reload"

    goto :goto_0

    :pswitch_3
    const-string v0, "off-route"

    goto :goto_0

    :pswitch_4
    const-string v0, "wrong-way"

    goto :goto_0

    :pswitch_5
    const-string v0, "user"

    goto :goto_0

    :pswitch_6
    const-string v0, "detour"

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_1
        :pswitch_0
        :pswitch_2
        :pswitch_3
        :pswitch_4
        :pswitch_5
        :pswitch_6
        :pswitch_2
    .end packed-switch
.end method


# virtual methods
.method public final a(Ljava/lang/String;)Lnbisdk/bd;
    .locals 6

    const/4 v5, 0x0

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0, p1}, Ljava/util/Hashtable;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/bd;

    if-nez v0, :cond_0

    move-object v0, v5

    :goto_0
    return-object v0

    :cond_0
    iget-wide v1, v0, Lnbisdk/bd;->cx:J

    const-wide/16 v3, 0x0

    cmp-long v1, v1, v3

    if-lez v1, :cond_1

    iget-wide v1, v0, Lnbisdk/bd;->cv:J

    iget-wide v3, v0, Lnbisdk/bd;->cx:J

    add-long/2addr v1, v3

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    cmp-long v1, v1, v3

    if-gez v1, :cond_1

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0, p1}, Ljava/util/Hashtable;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-object v0, v5

    :cond_1
    if-eqz v0, :cond_2

    iget-object v1, p0, Lnbisdk/a;->d:Lnbisdk/ov;

    const-string v2, "MemCache.get hit"

    invoke-virtual {v1, v2}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    iput-wide v1, v0, Lnbisdk/bd;->cv:J

    iget v1, v0, Lnbisdk/bd;->cw:I

    add-int/lit8 v1, v1, 0x1

    iput v1, v0, Lnbisdk/bd;->cw:I

    goto :goto_0

    :cond_2
    iget-object v1, p0, Lnbisdk/a;->d:Lnbisdk/ov;

    const-string v2, "MemCache.get miss"

    invoke-virtual {v1, v2}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public final a(Lnbisdk/bd;)V
    .locals 11

    const/4 v5, 0x0

    iget-object v0, p0, Lnbisdk/a;->d:Lnbisdk/ov;

    const-string v1, "MemCache.put"

    invoke-virtual {v0, v1}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0}, Ljava/util/Hashtable;->size()I

    move-result v0

    iget v1, p0, Lnbisdk/a;->b:I

    if-ne v0, v1, :cond_3

    iget-object v0, p0, Lnbisdk/a;->d:Lnbisdk/ov;

    const-string v1, "MemCache.put shrink"

    invoke-virtual {v0, v1}, Lnbisdk/ov;->info(Ljava/lang/String;)V

    new-instance v1, Ljava/util/Vector;

    iget v0, p0, Lnbisdk/a;->b:I

    invoke-direct {v1, v0}, Ljava/util/Vector;-><init>(I)V

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0}, Ljava/util/Hashtable;->elements()Ljava/util/Enumeration;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/util/Vector;->addElement(Ljava/lang/Object;)V

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lnbisdk/a;->a:Lnbisdk/ly;

    invoke-interface {v0, v1}, Lnbisdk/ly;->b(Ljava/util/Vector;)V

    iget v0, p0, Lnbisdk/a;->b:I

    div-int/lit8 v2, v0, 0x5

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    move v6, v5

    :goto_1
    iget v0, p0, Lnbisdk/a;->b:I

    if-ge v5, v0, :cond_2

    invoke-virtual {v1, v5}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lnbisdk/bd;

    iget-wide v7, v0, Lnbisdk/bd;->cx:J

    const-wide/16 v9, 0x0

    cmp-long v7, v7, v9

    if-lez v7, :cond_1

    iget-wide v7, v0, Lnbisdk/bd;->cv:J

    iget-wide v9, v0, Lnbisdk/bd;->cx:J

    add-long/2addr v7, v9

    cmp-long v7, v7, v3

    if-gez v7, :cond_1

    iget-object v7, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    iget-object v0, v0, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v7, v0}, Ljava/util/Hashtable;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    add-int/lit8 v0, v6, 0x1

    :goto_2
    add-int/lit8 v5, v5, 0x1

    move v6, v0

    goto :goto_1

    :cond_1
    if-ge v5, v2, :cond_5

    iget-object v7, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    iget-object v0, v0, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v7, v0}, Ljava/util/Hashtable;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    add-int/lit8 v0, v6, 0x1

    goto :goto_2

    :cond_2
    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_3

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget v1, v0, Lnbisdk/kh;->pn:I

    add-int/2addr v1, v6

    iput v1, v0, Lnbisdk/kh;->pn:I

    :cond_3
    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    iget-object v1, p1, Lnbisdk/bd;->ct:Ljava/lang/String;

    invoke-virtual {v0, v1, p1}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    sget-boolean v0, Lnbisdk/bk;->DEBUG:Z

    if-eqz v0, :cond_4

    invoke-static {}, Lnbisdk/kh;->hG()Lnbisdk/kh;

    move-result-object v0

    iget-object v1, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v1}, Ljava/util/Hashtable;->size()I

    move-result v1

    iput v1, v0, Lnbisdk/kh;->pl:I

    :cond_4
    return-void

    :cond_5
    move v0, v6

    goto :goto_2
.end method

.method public final clear()V
    .locals 1

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0}, Ljava/util/Hashtable;->clear()V

    return-void
.end method

.method public final close()V
    .locals 1

    iget-object v0, p0, Lnbisdk/a;->c:Ljava/util/Hashtable;

    invoke-virtual {v0}, Ljava/util/Hashtable;->clear()V

    return-void
.end method
